﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mr="http://mishrareader.codeplex.com/Reader"
                    xmlns:local="clr-namespace:MishraReader.ViewModels.Settings.Options"
                    xmlns:mishraReader="clr-namespace:MishraReader;assembly=MishraReader.ViewModels">

    <DataTemplate DataType="{x:Type local:TwitterConfigurationViewModel}" x:Key="twitterConfigContent">
        <Grid Width="400"  Height="450">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock 
                Text="{x:Static mishraReader:Strings.ConnectionToTwitter}" 
                Style="{DynamicResource MetroNormalText}" 
                VerticalAlignment="Center" 
                HorizontalAlignment="Center"/>

            <mr:HtmlViewer HtmlString="{Binding LoginUri}" NavigatingCommand="{Binding NavigatingCommand}" OpenLinksExternally="False"
                    Margin="10" 
                    x:Name="webBrowser" 
                    />
            
            <Button  Margin="0,15,0,0" Content="CLOSE" HorizontalAlignment="Right" 
                         Command="{Binding CancelCommand}"
                         IsCancel="True" Grid.Row="1" />
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding UserInputRequired}" Value="False">
                <Setter TargetName="webBrowser" Property="Visibility" Value="Collapsed" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate DataType="{x:Type local:TwitterConfigurationViewModel}">
        <mr:Dialog Showing="{Binding ShowData}" Content="{Binding}" 
                             AllowsTransparency="False"
                             Title="NotUsed"
                             ContentTemplate="{StaticResource twitterConfigContent}" />        
    </DataTemplate>
</ResourceDictionary>